from dataclasses import dataclass

from src.application.common.exceptions import ApplicationException


@dataclass
class UserIdNotExist(ApplicationException):
    user_id: int

    @property
    def message(self) -> str:
        return f'A user with the "{self.user_id}" user_id is not exists'


@dataclass
class UserTgIdNotExist(ApplicationException):
    user_tg_id: int

    @property
    def message(self) -> str:
        return f'A user with the "{self.user_tg_id}" telegram_id is not exists'


@dataclass
class UserEmailNotExist(ApplicationException):
    email: str

    @property
    def message(self) -> str:
        return f'A user with the "{self.email}" email is not exists'


@dataclass
class UserIdAlreadyExist(ApplicationException):
    user_id: int

    @property
    def message(self) -> str:
        return f'A user with the "{self.user_id}" user_id already exists'


@dataclass
class UserEmailAlreadyExist(ApplicationException):
    user_email: str

    @property
    def message(self) -> str:
        return f'A user with the "{self.user_email}" email already exists'


@dataclass
class NotEnoughBalance(ApplicationException):
    tg_user_id: int

    @property
    def message(self) -> str:
        return f"User {self.tg_user_id} balance is less than order summ"
